import type { ItemSale } from '@/types/item'
import type { PageParams, PageResult } from '@/types/common'
import { http } from '@/utils/http'

/**
 * 分页商品列表
 */
export const pageItemSale = (data?: PageParams) => {
  return http<PageResult<ItemSale>>({
    method: 'GET',
    url: '/api/itemSale/pageItemSale',
    data,
  })
}

/**
 * 商品详情
 * @param itemSaleId 商品id
 * @param sysBranchId 门店id
 */
export const selectItemSaleById = (itemSaleId: number, sysBranchId: number) => {
  return http<ItemSale>({
    method: 'GET',
    url: '/api/itemSale/selectItemSaleById',
    data: { itemSaleId, sysBranchId },
  })
}
